import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class ProgressDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Pregress"),
      ),
      body: new LinearProgressIndicatorDemo(),
    );
  }
}

/**
 * 条形进度条
 * */
class LinearProgressIndicatorDemo extends StatefulWidget {
  @override
  _LinearProgressIndicator createState() => new _LinearProgressIndicator();
}

class _LinearProgressIndicator extends State<LinearProgressIndicatorDemo> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Padding(
              padding: const EdgeInsets.symmetric(vertical: 18.0),
              child: LinearProgressIndicator(
                backgroundColor: Colors.grey[200],
                valueColor: AlwaysStoppedAnimation(Colors.blue),
              )),
          Padding(
              padding: const EdgeInsets.symmetric(vertical: 18.0),
              child: LinearProgressIndicator(
                backgroundColor: Colors.grey[200],
                valueColor: AlwaysStoppedAnimation(Colors.blue),
                value: .8,
              )),
          Row(
            children: <Widget>[
              Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 12.0),
                  child: CircularProgressIndicator(
                    backgroundColor: Colors.grey[200],
                    valueColor: AlwaysStoppedAnimation(Colors.blue),
                  )),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 12.0),
                child: CircularProgressIndicator(
                  backgroundColor: Colors.grey[200],
                  valueColor: AlwaysStoppedAnimation(Colors.blue),
                  value: .5,
                ),
              )
            ],
          ),
          Padding(
            padding: const EdgeInsets.symmetric(vertical: 12.0),
            child: SizedBox(
              height: 12,
              child: LinearProgressIndicator(
                backgroundColor: Colors.grey[200],
                valueColor: AlwaysStoppedAnimation(Colors.blue),
              ),
            ),
          ),
          Padding(padding: const EdgeInsets.symmetric(vertical: 12.0),
          child: SizedBox(
            height: 100,
            width: 100,
            child: CircularProgressIndicator(
              backgroundColor: Colors.grey[200],
              valueColor: AlwaysStoppedAnimation(Colors.blue),
              value: .2,
            ),
          ),
          )
        ],
      ),
    );
  }
}
